package com.test.springboot.mybatis.entity;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.test.springboot.mybatis.entity.enums.EnumMethodType;
import com.test.springboot.mybatis.entity.enums.EnumPayRecordStatus;
import com.test.springboot.mybatis.entity.enums.EnumRecordType;
import com.test.springboot.mybatis.utils.CustomDateTimeDeserializer;
import com.test.springboot.mybatis.utils.CustomDateTimeSerializer;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;


/**
 * @author chenxubing
 */
@Data
public class PayRecord {
  private int id = 0;

  @JsonSerialize(using = CustomDateTimeSerializer.class)
  @JsonDeserialize(using = CustomDateTimeDeserializer.class)
  private Date createTime = new Date();

  @JsonSerialize(using = CustomDateTimeSerializer.class)
  @JsonDeserialize(using = CustomDateTimeDeserializer.class)
  private Date opTime = new Date();

  private String companyId = "";

  private String companyCode = "";

  private String shopId = "";

  private String shopCode = "";

  private String tableNum = "";

  private String tableKey = "";

  private byte method = 0;

  private byte recordType = 0;

  private String cardNo = ""; 
  
  private String payer = "";

  private byte status = 0;

  private String users = "";

  private String billId = "";
  
  private String billNo = "";
  
  private String tradeNo = "";
  
  private String outTradeNo = "";
  
  private String voucher = "";

  private BigDecimal needMoney = BigDecimal.ZERO;

  private String remark = "";
  
  private byte deleteFlag = 0;
  
  public EnumRecordType getRecordTypeEnum(){
      return EnumRecordType.of(recordType);
  }
  
  public EnumMethodType getMethodTypeEnum(){
      return EnumMethodType.of(method);
  }
  
  public EnumPayRecordStatus getStatusEnum(){
      return EnumPayRecordStatus.of(status);
  }
  
}
